package com.qingke.notlonely.command.system;

import com.qingke.notlonely.bean.Yue;
import com.qingke.notlonely.command.SystemCommand;
import com.qingke.notlonely.util.NLConsole;

public class DeleteYue extends SystemCommand{

	@Override
	public void execute() {
		int id=NLConsole.getInt("yue id:");
		boolean isExist=dao.isYueExistById(id);
		if(!isExist){
			NLConsole.println("the yue is not exist.");
			return ;
		}
		
		Yue yue=dao.selectYueById(id);
		boolean isSuccess=dao.delete(yue);
		if(isSuccess)
			NLConsole.println("delete yue success.");
		else
			NLConsole.println("delete yue failed.");
	}

}
